
<?php
$this->headLink()->appendStylesheet($this->baseUrl() . '/public/styles/datepicker/jquery.datepick.css');
$this->headScript()->prependFile($this->baseUrl() . '/public/scripts/datepicker/jquery.datepick.js');
?>

<article class="module width_full">
    <header><h3>Editar Alcance</h3></header>
    <div class="module_content">
        <?php
        echo $this->form;
        ?>
        <div id="tareas" >
            <table align="center">
                <?php $title_tareas = ($this->row->count() <= 0)? "No hay tareas": "Lista de tareas" ?>
                <caption><?php echo $title_tareas ?></caption>
                <?php foreach ($this->row as $tareas) { ?>
                    <tr>
                        <td><?php echo $tareas->title ?></td>
                        <td><a href="<?php echo $this->url(array('module'=>'tarea', 'controller'=>'index', 'action'=>'edit', 'id'=>$tareas->id)) ?>">Ver tarea</a></td>
                    </tr>
                <?php } ?>
            </table>
        </div>
        <div style="clear: left"></div>
    </div>
</article>


<div style="display: none;">
    <img id="calImg" src="<?php echo $this->baseUrl() . '/public/img/calendar-blue.gif' ?>" alt="Popup" class="trigger">
</div>

<script>
    $(function() {
        $('#end_date').datepick({
            showOnFocus: false, 
            showTrigger: '#calImg',
            dateFormat: 'dd-mm-yyyy'
        });
        $('#finalizar').css({
            'margin-top': '-41px',
            'margin-left': '90px',
            'display': 'table'
        });
        $('#finalizar').click(function(e){
            e.preventDefault();
            location.href = '<?php echo $this->url(array('module' => 'alcance', 'controller' => 'index', 'action' => 'view'), null, true) ?>';
            return false;
        })
    });
</script>


<style>
    
    #form_alcance, #tareas{
        width: 45%;
        float: left;
    }
    
    #tareas table tr td{
        padding: 3px 10px;
       
    }
    
    #tareas table caption, #tareas table{
        border: 1px solid #ccc
    }  
    
    #tareas table{
        min-width: 200px;
    }
    
</style>